#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1e5+10;
const int MAXE = 5e5+10;

typedef long long ll;

int h[MAXN],low[MAXN],dfn[MAXN],siz[MAXN],tot,cnt,n,m;
ll ans[MAXN];

typedef struct{int v,nxt;} edge;

edge e[MAXE<<1];

void link(int x,int y){e[++cnt] = (edge){y,h[x]};h[x] = cnt;}

void dfs(int x){
	dfn[x] = low[x] = ++tot;siz[x] = 1;
	ll sum = 0;
	for(int i = h[x];i;i = e[i].nxt){
		int y = e[i].v;
		if(!dfn[y]){
			dfs(y);
			low[x] = min(low[x],low[y]);
			if(low[y] >= dfn[x]){
				ans[x] += sum * siz[y];
				sum += siz[y];
			}
			siz[x] += siz[y];
		}else low[x] = min(low[x],dfn[y]);
	}
	ans[x] += sum * (n-sum-1);
	ans[x] += n-1;
}

int main (){
	scanf("%d %d",&n,&m);
	for(int i = 1;i <= m;i++){
		int x,y;scanf("%d %d",&x,&y);
		link(x,y);link(y,x);
	}
	dfs(1);
	for(int i = 1;i <= n;i++) printf("%lld\n",ans[i]<<1);
	return 0;
}
